#!bin/bash

echo "copy file to default build dir..."
mkdir -p ~/rpmbuild/SOURCES/etc
cp -rf ./SOURCES/bin  ~/rpmbuild/SOURCES/
cp -rf ./SOURCES/etc  ~/rpmbuild/SOURCES/
cp -rf ./SPECS/smshell.spec  ~/rpmbuild/SPECS/

cd ~/rpmbuild/SPECS
echo "buid rpm..."
rpmbuild -ba ~/rpmbuild/SPECS/smshell.spec
echo "clean..."
rm -rf ~/rpmbuild/SOURCES/bin
rm -rf ~/rpmbuild/SOURCES/etc
rm -rf ~/rpmbuild/SPECS/smshell.spec
echo "rpm build done."



